package com.azt.api.dto.item;

import com.azt.api.pojo.Product;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

public class ProductExt extends Product {

    private String categoryNameF;
    private String categoryNameS;
    private String categoryNameT;

    private String brandName;//品牌
    private String companyName;//公司


    private Double minMemberPrice;//最小会员价

    //目前仅用于 爆品首页与商城首页爆品的展示
    private Double minHotPrice;//最小爆品价


    //店铺id
    private Integer shopid;


    /**
     * 拆分标题图
     * Created by 张栋 on 2017/2/15 19:10
     */
    public List<String> getTitleImg(){
        if(getPicPath()!=null && !"".equals(getPicPath())){
            String[] split = getPicPath().split(";");
            return Arrays.asList(split);
        }
        return null;
    }

    /**
     * 标题首张图
     * Created by 张栋 on 2017/2/15 19:10
     */
    public String getFirstImg(){
        List<String> titleImgs = getTitleImg();
        if(titleImgs!=null ){
            return titleImgs.get(0);
        }
        return null;
    }


    public String getCategoryNameF() {
        return categoryNameF;
    }

    public void setCategoryNameF(String categoryNameF) {
        this.categoryNameF = categoryNameF;
    }

    public String getCategoryNameS() {
        return categoryNameS;
    }

    public void setCategoryNameS(String categoryNameS) {
        this.categoryNameS = categoryNameS;
    }

    public String getCategoryNameT() {
        return categoryNameT;
    }

    public void setCategoryNameT(String categoryNameT) {
        this.categoryNameT = categoryNameT;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public Double getMinMemberPrice() {
        return minMemberPrice;
    }

    public void setMinMemberPrice(Double minMemberPrice) {
        this.minMemberPrice = minMemberPrice;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public Double getMinHotPrice() {
        return minHotPrice;
    }

    public void setMinHotPrice(Double minHotPrice) {
        this.minHotPrice = minHotPrice;
    }

    public Integer getShopid() {
        return shopid;
    }

    public void setShopid(Integer shopid) {
        this.shopid = shopid;
    }
}